import { Spin } from "antd"
import { FC } from "react"
import { useSelector } from "react-redux"

import { AppState } from "@/stores"

const SpinLoad: FC = () => {
	const { loading } = useSelector((state: AppState) => state.global)
	return (
		<Spin
			spinning={loading}
			fullscreen
			// delay={2000}
			// className="app-loading-wrapper"
			// style={{
			// 	backgroundColor: theme === "dark" ? "rgba(0, 0, 0, 0)" : "rgba(255, 255, 255, 0)"
			// }}
			// tip={<LocaleFormatter id="gloabal.tips.loading" />}
		></Spin>
	)
}

export default SpinLoad
